<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>测试二维码demo</title>
    <script type="text/javascript" src="../js/jquery-3.0.0.min.js"></script>
    <script src="../js/qrcode.min.js"></script>

</head>
<body>
<div id="qrcode" style="width:100px; height:100px; margin-top:15px;"></div>

<script>
    var qrcode = new QRCode(document.getElementById("qrcode"), {
        width : 100,
        height : 100
    });

    function makeCode () {
        var elText = 'www.baidu.com';

        qrcode.makeCode(elText);
    }
    makeCode();

</script>
</body>
</html>